#include<iostream>
#include<string>
//#include <cstdlib>
using namespace std;

class Singleton
{
public:
	static Singleton* getInstance()
	{
		if (instance == nullptr)
		{
			instance = new Singleton();
			return instance;
		}
		else
			return  instance;
	}
	static void print_instance()
	{
		cout<<name <<" " <<age <<endl;
	}
	~Singleton() {};
private:
	Singleton() {};
	static Singleton* instance;
	static int age;
	static string name;
};

int  Singleton::age = 90;
string Singleton::name = "lisan";
Singleton* Singleton::instance = nullptr;

class A
{

public:
	void print_a()
	{
		 Singleton::getInstance()->print_instance();
	}

};
int main()
{
	A a;
	a.print_a();
//	system("pause");
    return 0;
}

